package com.yanyuan.algorithm.queue;

/**
 * @Description 循环队列测试
 * @Author yanyuan
 * @Date 11:18 2020/5/8
 * @Version 1.0
 **/
public class SqQueueTest {
    public static void main(String[] args) {
        SqQueue<String> queue = new SqQueue<>(5);
        queue.put("诸葛亮");
        queue.put("庞统");
        queue.put("姜维");
        queue.put("马稷");
        queue.put("关羽");//循环队列会牺牲一个存储空间

        System.out.println("队列 为空：" + queue.isEmpty() + " ,队列是否已满：" + queue.isFull());
        while (!queue.isEmpty()){
            System.out.print("name：" + queue.take() + " | ");
        }
        System.out.println();
        System.out.println("队列 为空：" + queue.isEmpty() + " ,队列是否已满：" + queue.isFull());

    }
}
